package net.xju_11_12.handler;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class PerformHandler implements InvocationHandler {

    // 目标对象
    private Object target;
    public PerformHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("方法之前");
        Object invoke = method.invoke(target, args);
        System.out.println("方法之后");
        return invoke;
    }

}
